package com.example.mtbatissource.mock;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mock")
public class MockController {

    @Autowired
    private MockServiceImpl mockService;

    @PostMapping("/demo")
    public String mockDemo() {
        print();
        return  mockService.mockService();
    }

    public boolean print() {
        System.out.println("打印数据");
        return true;
    }

    public void print2() {
        System.out.println("打印数据");
    }

    @PostMapping("/demo2")
    public String mockDemo2() {
        print();
        System.out.println("打印已执行");
        print2();
        return "OK";
    }

}
